package com.moonstar;

import javax.swing.*;

public class myThread4 extends Thread{
    private JTextArea jt;

    myThread4(JTextArea jt){
        this.jt=jt;
    }

    @Override
    public void run() {
        while (true){
            try {
                sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            synchronized (work2.Lock){
                for(int i=0;i<100;i++){
                    try {
                        sleep(40);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    jt.setText(String.valueOf(work2.index3));
                    work2.index3--;
                }
            }
        }
    }
}
